<?php
/**
 * Created by PhpStorm.
 * Author: ls
 * Time: 2023/12/26 11:44
 * Desc: 景点预订工厂
 */

class Service_Api_Ferry_Booking_Factory
{

    private static $this;

    /**
     * @param array $ferry
     * @return Service_Api_Ferry_Booking_Multiple|Service_Api_Ferry_Booking_Single
     */
    public static function get_instance($ferry)
    {
        if (is_null(self::$this)) {
            if ($ferry['is_open_multiple_ticket'] == 1) {
                self::$this = new Service_Api_Ferry_Booking_Multiple($ferry);
            } else {
                self::$this = new Service_Api_Ferry_Booking_Single($ferry);
            }
        }
        return self::$this;
    }
}